using BasicsClassLibrary.Tool.Configure;
using BasicsClassLibrary.Tool.ConsulSet;
using WebApplication1;
IConfiguration configuration = new ConfigurationBuilder()
                            .AddJsonFile("appsettings.json")
                            .Build();
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(new AppHelper(configuration));
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();
//app.Urls.Add("http://localhost:5001");
app.Urls.Add("http://*:5001");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}


app.UseAuthorization();
app.Configuration.RegToConsul();
app.MapControllers();

app.Run();
